import request from '@/utils/request'

// 获取部门列表
export function getDepartments() {
  // 新增 url , method , data , params
  return request({
    url: '/company/department'
  })
}

export function addDepartments(data) {
  // 新增 url , method , data , params
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 查询部门详情

export function getDepartmentsDetail(id) {
  // 新增 url , method , data , params
  return request({
    url: `/company/department/${id}`
  })
}

// 修改部门详情
export function getDepartmentsPut(data) {
  // 新增 url , method , data , params
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门
export function delDepartmentsEte(id) {
  // 新增 url , method , data , params
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

